home *** CD-ROM | disk | FTP | other *** search
- Subject: Menu Questions
- Sent: 5/11/96 10:22 AM
- Received: 5/11/96 12:37 PM
- From: Nolan Larsen, nlarsen@dharbor.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- I came across a couple of bugs in the file FWPullDM.cpp of ODF d11. The
- FW_CPullDownMenu::EnableAll method uses the following code:
-
- (*fPlatformMenu)->enableFlags &= 0xFFFFFFFF;
-
- Anding everything with 1 does nothing to enableFlags. In fact, the compiler
- optimizes the code out so nothing is generated to enable the menus. The
- following will produce the desired effect:
-
- (*fPlatformMenu)->enableFlags = 0xFFFFFFFF;
-
-
- The FW_CPullDownMenu::DisableAll has a slightly different problem. It uses
- the following line of code to disable all of the menu items:
- (*fPlatformMenu)->enableFlags &= 0x00000001;
- This code does disable all of the items but does not disable the menu
- itself. According to the HI guidelines, if all menu items are disabled the
- menu itself should also be disabled. The following is more in keeping with
- the guidelines:
-
- (*fPlatformMenu)->enableFlags = 0x00000000;
-
- BTW, What is the best way to handle a font menu? I am using the follwing
- code to create the font menu:
-
- fFontPullDownMenu = new FW_CPullDownMenu(ev, resFile, kMenuStrings,
- kFontMenuStr);
-
- FW_CFontIterator myFonts;
- FW_CIntlString myString = myFonts.First();
- while (myString != "")
- {
- fFontPullDownMenu->AppendTextItem(ev, myString, cFontName);
- myString = myFonts.Next();
- }
-
- menuBar->AdoptMenuLast(ev, fFontPullDownMenu);
-
- This seems to work, but seems terribly inefficient to create a dummy font
- menu, do the AppendResMenu, and then copy the fonts over one by one into my
- menu. Why can't I just ask ODF to fill my menu with fonts?
-
- Once I have the menu created, I want to use the menu item text to tell me
- which font to set when one is chosen from the menu. How can I get the item
- text of the selected item in my part's DoMenu method?
-
- While on the subject of menus. When building a Style menu with Bold,
- Italics, etc. in it, what is the best way to set the appropriate attributes
- for each item. This is a similar issue for the Size menu which should use
- Outline for installed fonts.
-
- Thanks,
- Nolan
-
- =========================================================================
- Nolan Larsen Digital Harbor
- nlarsen@dharbor.com "Pier-to-Pier Computing"
- =========================================================================
-
-